package com.thz.common.enums;

import lombok.Getter;

/**
 * 转换类型枚举
 * 
 * @author THZ
 * @date 2025
 */
@Getter
public enum ConversionType {
    
    /**
     * 视频转GIF
     */
    VIDEO_TO_GIF("VIDEO_TO_GIF", "视频转GIF"),
    
    /**
     * 文件转SVG
     */
    FILE_TO_SVG("FILE_TO_SVG", "文件转SVG"),
    
    /**
     * 图片抠图
     */
    IMAGE_MATTING("IMAGE_MATTING", "图片抠图"),

    /**
     * DOCX 转 PDF
     */
    DOCX_TO_PDF("DOCX_TO_PDF", "DOCX转PDF");
    
    private final String code;
    private final String description;
    
    ConversionType(String code, String description) {
        this.code = code;
        this.description = description;
    }
    
    /**
     * 根据代码获取枚举
     */
    public static ConversionType fromCode(String code) {
        for (ConversionType type : values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        throw new IllegalArgumentException("未知的转换类型: " + code);
    }
}

